#!/home/hadoop/python26/bin/python
import sys

last_key = ''
local_buffer = []
for line in sys.stdin:
    w = line.strip().split('\t')
    key = w[0]
    value = w[1]
    if key != last_key and last_key != '':
        print local_buffer[0]
        local_buffer = []
    local_buffer.append(value)
    last_key = key
if len(local_buffer) > 0:
    print local_buffer[0]
